package com.hzit.bj1804.dianweb.service;


import com.github.pagehelper.PageInfo;
import com.hzit.bj1804.dian.entity.Productcategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@FeignClient(value = "USER-CLIENT",fallback = ProductategoryServiceImpl.class)
public interface ProductategoryService {
    /**
     * 查询所有类别
     */
    @RequestMapping("/get_type")
    List<Productcategory> getAllProductcategoryType();

    /**
     * 分页查询类别信息
     * @param limit
     * @param page
     * @return
     */
    @RequestMapping("probypage")
    PageInfo<Productcategory> getAllTypeByPage(@RequestParam("limit") int limit, @RequestParam("page") int page);

    /**
     * 根据ID获取类别信息
     * @param categoryid
     * @return
     */
    @RequestMapping("findByid")
    @ResponseBody
    List<Productcategory> getCategoryById(@RequestParam("categoryid") int categoryid);
    /**
     * 根据类别名模糊查询
     * @param categoryname
     * @return
     */
    @RequestMapping("byIdAndName")
    @ResponseBody
    List<Productcategory> getByIdAndName(@RequestParam("categoryname") String categoryname);
    /**
     * 修改所选类别信息
     */
    @RequestMapping("uptype")
    int upType(@RequestBody Productcategory productcategory);
    /**
     * 添加类别
     */
    @RequestMapping("addtype")
    int addType(@RequestBody Productcategory productcategory);
    /**
     * 修改状态
     */
    @RequestMapping("delup")
    int delUpStatus(@RequestParam("categoryid") int categoryid);
}
